<template>
  <div class="brand-item">
    <div class="brand-logo" :style="{'background-image':'url('+img+')'}" :class="{'default':isDefault}"></div>
    <div class="brand-name" :class="{'default':isDefault}">{{name}}</div>
    <div class="brand-divide" :class="{'default':isDefault}"></div>
    <div class="brand-desc" :class="{'default':isDefault}">{{desc}}</div>
  </div>
</template>

<script>
export default {
  props: {
    isDefault: { // 是否是敬请期待
      type: Boolean,
      default: false
    },
    img: {
      type: String, // 企业logo图片url
      default: ''
    },
    name: {
      type: String, // 企业名称
      default: '敬请期待'
    },
    desc: {
      type: String, // 企业简介
      default: '品牌名片持续更新中...'
    },
    itemid: {
      type: String, // 企业id
      default: ''
    }
  }
}
</script>

<style scoped lang="scss">
.brand-item {
  display: inline-block;
  width: 3.3rem;
  height: 4.2rem;
  background-color: #fff;
  box-shadow: 0 0 0.24rem 0 rgba(0, 0, 0, 0.1);
  margin: 0 0.15rem 0.27rem 0.15rem;
  vertical-align: top;
  .brand-logo {
    width: 2.82rem;
    height: 1.75rem;
    margin: 0.22rem auto 0;
    background: center no-repeat;
    background-size: contain;
    &.default {
      background-image: url(../assets/brand-default.png) !important;
      background-position-y: 0.47rem !important;
    }
  }
  .brand-name {
    margin: 0.2rem 0 0 0.24rem;
    font-size: 0.3rem;
    color: #444;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    &.default {
      text-align: center;
      color: #999;
      font-weight: normal;
    }
  }
  .brand-divide {
    width: 0.7rem;
    height: 1px;
    margin: 0.2rem 0 0 0.24rem;
    background-color: rgba(0, 0, 0, 0.3);
    &.default {
      margin-left: auto;
      margin-right: auto;
    }
  }
  .brand-desc {
    width: 2.78rem;
    margin: 0.2rem auto 0;
    font-size: 0.26rem;
    line-height: 0.37rem;
    color: #444;
    opacity: 0.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* autoprefixer: ignore next */
    -webkit-box-orient: vertical;
    &.default {
      font-size: 0.24rem;
      color: #999;
      text-align: center;
    }
  }
}
</style>
